<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  
<html xmlns = "http://www.w3.org/1999/xhtml">
  <!-- 2012 lukbrasil -->
  <!-- Internet & World Wide Web How To Program - Exercise 9.16 -->
  <head>
    <title>Exercise 9.16</title>
    
    <script type = "text/javascript">
      <!--
      function drawSquare(side) {        
        if (!isNaN(side)) {
          document.writeln("<pre>");
          for (var i = 0; i < side; ++i) {
            for (var j = 0; j < side; ++j) {
              document.write("*");
            }
            document.writeln();
          }
          document.writeln("</pre>");
        }
      }
      
      function draw() {
        drawSquare(parseInt(document.getElementById("sideField").value));
      }
      // -->
    </script>
  </head>
  <body>
    <form action = "">
      <div>
        <label>Side </label>
        <input id = "sideField" type = "text"/>
        <input type = "button" value = "Draw" onclick = "draw()"/>      
      </div>
    </form>
  </body>
</html>
